<template>
    <div>
        <h2 class="h2"><span>军籍信息表--现役军人家属</span></h2>
        <div>
            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="140px" class="demo-ruleForm qita" id="qita" accept-charset="UTF-8">
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item class="select2" label="现单位性质(含离退休前)：" prop="E007">
                            <el-select v-model="ruleForm.E007" placeholder="现单位性质(含离退休前)">
                                <el-option label="国家机关" value="1"></el-option>
                                <el-option label="事业单位" value="2"></el-option>
                                <el-option label="国有企业" value="3"></el-option>
                                <el-option label="集体企业" value="4"></el-option>
                                <el-option label="外资企业私营企业" value="5"></el-option>
                                <el-option label="公益性岗位" value="6"></el-option>
                                <el-option label="自由职业" value="7"></el-option>
                                <el-option label="创业" value="7"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                         <el-form-item label="是否随军：" prop="E034">
                            <el-radio-group v-model="ruleForm.E034">
                                <el-radio label="是"></el-radio>
                                <el-radio label="否"></el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item>
                        <el-button type="primary" @click="submitForm('ruleForm')">下一步</el-button>
                        <el-button @click="resetForm('ruleForm')">重置</el-button>
                    </el-form-item>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return {
            ruleForm: { //默认数据
                E007:'',//现单位性质(含离退休前)：
                E034:'',//是否随军
            },
            rules: {  //规则
                E007:[
                    { required: true, message: '请选择现单位性质(含离退休前)', trigger: 'change' }
                ],
                E034:[
                    { required: true, message: '请选择现单位性质(含离退休前)', trigger: 'change' }
                ],
            },
        }
    },
    methods: {
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    alert('成功，tuiyishibing!');
                    console.log(this.ruleForm)
                    this.$emit('submitfn',2)
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },
        resetForm(formName) {
            this.$refs[formName].resetFields();
        },
    },
    components:{
        
    }
}
</script>

<style scoped>
.el-row {
    margin-bottom: 20px;
}
.el-row:last-child {
    margin-bottom: 0;
}
</style>